import java.io.IOException;
import java.util.HashMap;
import java.util.List;

import org.apache.http.client.ClientProtocolException;

import com.alibaba.fastjson.JSON;
import com.bootdo.common.utils.HttpUtil;
import com.bootdo.common.wx.WeiXinUtil;

import net.sf.json.JSONObject;

public class cnmsss {
	
	public static void main(String[] args) throws ClientProtocolException, IOException {
		
		List userList = getUserList();
	}

	/**
	 * @param args
	 * @throws IOException 
	 * @throws ClientProtocolException 
	 */
	public static List getUserList() throws ClientProtocolException, IOException {
		String access_token =WeiXinUtil.getOauth2AccessToken2("wxcb74c2a7fb1fd161",  "3ba771e951e1e0e917b7dcd777a25e06");
		String url = "https://api.weixin.qq.com/cgi-bin/user/get?access_token="+access_token;
		String result = HttpUtil.doGet(url, null);
		JSONObject resultJson = JSONObject.fromObject(result); 
		JSONObject data = (JSONObject) resultJson.get("data");
		List openidlist = (List) data.get("openid");
		return openidlist;
	}
}
